
import regeneratorRuntime from '../../lib/runtime/runtime';
import { request } from "../../requests/index.js";
import { login } from "../../utils/asyncWx.js";


Page({

  
  async handleGetUserInfo(e){
   
    // const {encryptedData,rawData,iv,signature}=e.detail;
    // const { code } = await login();
    // const loginParams={ encryptedData, rawData, iv, signature ,code};
    // //  3 发送请求 获取用户的token
    // const token=await request({url:"/users/wxlogin",data:loginParams,method:"post"});
    // console.log(token);
    // 4 把token存入缓存中 同时跳转回上一个页面
    wx.setStorageSync("token", "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1aWQiOjIzLCJpYXQiOjE1NjQ3MzAwNzksImV4cCI6MTAwMTU2NDczMDA3OH0.YPt-XeLnjV-_1ITaXGY2FhxmCe4NvXuRnRB8OMCfnPo");
    wx.navigateBack({
      delta: 1
    });  
  }

})